package cn.observer2;

/**
 * Created by jt on 2018/3/22.
 */
public class People implements  Observer {
    private Observable observable ;

    private String name ;

    public People(String name,Observable observable){
        this.name = name ;
        this.observable = observable ;

        observable.addObserver(this);
    }


    @Override
    public void update(String msg) {
        System.out.println(name + "监视" + msg);
    }
}
